// pages/article/article.js

import API from "../../data/api";
import Util from "../../utils/util";

const App = getApp();

Page({
  data: {
    listData: null,
  },
  onLoad: function (options) {
    // console.log(options.articleid);
    var that = this;
    that.getArticle(options.articleid);
  },

  // 获取文章内容
  getArticle: function (id) {
    var that = this;
    var Config = App.Config;
    API.getArticle(id)
      .then((res) => {
        // console.log(res);
        if (res.data.error == Config.ERR.OK) {
          that.setData({
            listData: res.data.data,
          });
        }
      });
  },

})